package com.bjpowernode.custom_annotation;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.bjpowernode.custom_annotation.SomeService;

/**
 * 使用注解方式实现aop，扫描切面类和目标方法类
 * @author Wolfe
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:com/bjpowernode/custom_annotation/applicationContext.xml")
public class MyTest {
	
	@Autowired
	SomeService service;
	
	
	@Test
	public void someServiceTest() {
		
		//目标对象实现了接口，所有默认使用jdk的动态代理
//		System.out.println("service:"+service.getClass().getName());
		//通过代理对象执行业务方法， 实现功能增强
//		service.doSome();
		
		service.createCar();
		
		service.createUser();
		

	}

}
